﻿
using Newtonsoft.Json.Converters;
namespace Muccu.Contracts
{
    public static class JsonExtension
    {
        private static Newtonsoft.Json.JsonSerializerSettings SETTING;

        static JsonExtension()
        {
            SETTING = new Newtonsoft.Json.JsonSerializerSettings
            {
                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(),
            };
            //SETTING.Converters.Add(new JavaScriptDateTimeConverter());
        }
        public static string ToJson(this object src)
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(src, Newtonsoft.Json.Formatting.None, SETTING);
        }
    }
}
